// packageH/interests_give/interests_give.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    total: 0,
    new:false,
  },
  onLoad: function(options){
    if(options.new){
      this.setData({
        new : true
      })
    }
  },
  onShow: function () {
    this.getData();
  },

  getData () {
    let urlStr = app.getNetAddresss(this.data.new?"plugin.full-return.frontend.queue.index".replace(/full-return/g,'full-reward'):"plugin.full-return.frontend.queue.index");
    app._getNetWork({
      url: urlStr,
      data: {},
      success: (res) => {
        if (res.data.result !== 1) {
          wx.showToast({
            title: res.data.msg,
            icon: "none"
          });
          return;
        }
        wx.setNavigationBarTitle({
          title: res.data.data.name,
        });
        this.setData({
          total: res.data.data.queue_total
        });
      }
    });
  }

});